<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Document</title>
	<css file="__PUBLIC__/Css/style.css"/>
	<js file="__PUBLIC__/Js/jquery-1.7.2.min.js"/>
</head>
<body>
	<section class="widget" style="min-height:300px">
		<header>
			<span class="icon"></span>
			<hgroup>
				<h1>主页配置</h1>
				<a href="">填写表单</a>
			</hgroup>
		</header>
	<form action="{:U(GROUP_NAME.'/Home/Handle')}" method="post" class="home">
		<h2>
			设置背景图
		</h2>
		<div class="bg"> 
			<foreach name="bgs" item="v">
				<input type="radio" name="bg" value="{$v}"><img src="/Public/images/bg/{$v}.jpg" alt="" id="bg{$v}" />
			</foreach>
		</div>
		<h2>
			设置首页图
		</h2>
		<div class="art">
			<foreach  name="arts" item="v">
				<input type="radio" name="art" value="{$v}"><img src="/Public/images/art/{$v}.jpg" alt="" id="at{$v}" />
			</foreach>
		</div>	
		<h2>
			设置热门标签
		</h2>
		<div class="art">
			<foreach name="hot" item="v">
			<input type="text" name="hot[]" value="{$v}" />
			</foreach>
			<input type="text"  name="hot[]" />
		</div>
			
		<div>
			<button type="submit" class="green">提交修改</button>
		</div>
	</form>
<script>
	$(function(){
		$('#bg{:C('bg')}').css('border-color','red');
		$('#at{:C('art')}').css('border-color','red');
		$('.bg input[value={:C('bg')}]').attr('checked','checked');
		$('.art input[value={:C('art')}]').attr('checked','checked');
		imgclick(".bg");
		imgclick(".art");
		
	});
	function imgclick(elem){
		$(elem+' img').click(function(){
			$(elem+' input[value]').attr('checked',false);
			$(elem+' img').css('border-color','#999');
			$(this).css('border-color','red');
			var i=$(this).attr('id').substr(2,$(this).attr('id').length-2);
			$(elem+' input[value='+i+']').attr('checked','checked');
		});
	}
</script>
	</section>
</body>
</html>